<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(){
            this.name="刘德华"
        }

        Person.prototype.name="刘德华"
        var p=new Person();



        function isProto(obj,attr){
            if(attr in obj && !Object.hasOwnProperty.call(obj,attr)){
                return true;
            }
            return false;
        }

        console.log(isProto(p,name));
    </script>
</body>
</html>